package com.tikou.ui.view.circleview;

import android.view.animation.Animation;
import android.view.animation.Transformation;

/**
 * Created by Tikou on 2018/1/3 09:58.
 * 作者：wangwei
 * 邮箱：ww@winning.com.cn
 * 说明：
 * 参考：
 */

public class CircleBarAnim extends Animation {
    private CircleBarView circleBarView;
    public CircleBarAnim() {
    }

    /**
     * @param circleBarView 绑定动画和view
     */
    public void bindView(CircleBarView circleBarView){
        this.circleBarView = circleBarView;
    }

    @Override
    protected void applyTransformation(float interpolatedTime, Transformation t) {
        super.applyTransformation(interpolatedTime, t);
        if (circleBarView==null){
            throw new NullPointerException("circleBarView 未初始化绑定");
        }else {
            circleBarView.setSweepAngle(interpolatedTime*360);
        }

    }
}
